/**
 * Author: Jordi Vilaplana Mayoral <jvilaplana@alumnes.udl.cat>
 * Date: 05/04/2011
 * 
 * LocationManager
 * Copyright (C) 2011 Jordi Vilaplana Mayoral
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * @(#)
 * Description: This program allows users to book rooms and schedule activities
 */

package locmanager.persistence;

import java.util.Date;
import java.util.List;
import locmanager.beans.ActivityBean;
import locmanager.beans.ActivityEquipmentBean;
import locmanager.beans.EquipmentBean;
import locmanager.beans.LocationBean;
import locmanager.beans.RoomTypeBean;
import locmanager.beans.UserBean;

/**
 * Persistence Interface.
 * 
 * @author Jordi Vilaplana Mayoral <jvilaplana@alumnes.udl.cat>
 * @version 1.0
 */
public interface Persistence {

  void connect(String driver, String url, String user, String password);

  void disconnect();

  LocationBean getLocation(int locationId);

  List<LocationBean> getLocations();

  boolean insertLocation(String publicName, int roomTypeId, int capacity);

  boolean deleteLocation(LocationBean location);

  boolean updateLocation(LocationBean location);

  List<RoomTypeBean> getRoomTypes();

  boolean insertRoomType(String typeName);

  boolean deleteRoomType(RoomTypeBean roomType);

  boolean updateRoomType(RoomTypeBean roomType);

  boolean insertActivity(ActivityBean activity);

  boolean deleteActivity(ActivityBean activity);

  boolean updateActivity(ActivityBean activity);

  List<ActivityBean> getActivitiesByLocation(LocationBean location);

  List<ActivityBean> getActivitiesByLocation(LocationBean location, Date date);

  EquipmentBean getEquipmentById(int equipmentId);

  List<EquipmentBean> getEquipments();

  boolean insertEquipment(String publicName);

  boolean deleteEquipment(EquipmentBean equipment);

  boolean updateEquipment(EquipmentBean equipment);

  boolean insertActivityEquipment(int activityId, int equipmentId);

  boolean deleteActivityEquipment(ActivityEquipmentBean activityEquipment);

  boolean updateActivityEquipment(ActivityEquipmentBean activityEquipment);

  UserBean selectUser(String userName, String password);

  boolean insert(String query);

  boolean update(String query);

  boolean delete(String query);

  Object select(String query);
  
}
